package br.com.pd.messaging;

import java.net.InetAddress;
import java.net.UnknownHostException;

import br.com.util.PropertiesLoader;


public abstract class AbstractMessage implements MessageIF {

	/**
	 * 
	 */
	private final static String SUBSCRIBE = "subscribe";
	private final static String COTATION = "cotation";
 	
	private static final long serialVersionUID = 8164197199394401313L;
	protected String id;
	protected String operation;
	protected String from;
	protected int portSender;
	protected int portReceiver;
	protected String to;
	
	
	public AbstractMessage(){
		try {
			this.from = InetAddress.getLocalHost().getHostAddress();
		} catch (UnknownHostException e) {
			e.printStackTrace();
		}
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}

	public String getOperation() {
		return this.operation;
	}
	
	
	public String getFrom() {
		return from;
	}
	public void setFrom(String from) {
		this.from = from;
	}
	
	public String getTo() {
		return to;
	}
	
	public void setTo(String to) {
		this.to = to;
	}
	
	public int getPortSender() {
		return portSender;
	}
	public void setPortSender(int portSender) {
		this.portSender = portSender;
	}
	public int getPortReceiver() {
		return portReceiver;
	}
	public void setPortReceiver(int portReceiver) {
		this.portReceiver = portReceiver;
	}
	public abstract void addResponse(Object o );

	public abstract Object getResponse();

}
